﻿using Architecture.Domian;
using Architecture.Domian.Entity;
using Architecture.Repository.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Architecture.Repository.Impl
{
    // 单一模块接口实现
    public class RoleRepository : BaseRepository<RoleInfo>, IRoleRepository
    {
        public RoleRepository(EFCoreDbContext dbContext) : base(dbContext)
        {
        }

        public async Task<int> AddAsync(RoleInfo entity)
        {
            return await base.AddAsync(entity);
        }

        public async Task<List<RoleInfo>> GetAllAsync()
        {
            return await base.GetAllAsync();
        }

        public async Task<List<RoleInfo>> GetAsync(Expression<Func<RoleInfo, bool>> expre)
        {
            return await base.GetAsync(expre);
        }

        public async Task<RoleInfo> GetByFuncAsync(Expression<Func<RoleInfo, bool>> expre)
        {
            return await base.GetByFuncAsync(expre); 
        }

        public async Task<RoleInfo> GetByIdAsync(int id)
        {
            return await base.GetByIdAsync(id);
        }

        public async Task<int> UpdateAsync(RoleInfo entity)
        {
            return await base.UpdateAsync(entity);
        }
    }
}
